var stockIn = {
	props: ['title','rr_id'],
	data: function() {
		return {
			info: {},
			form_data: {
				qty: 1,
				remarks: ''
			},
			baseUrl: '/mr_new/public/index.php/depot'
		}
	},
	watch: {
		rr_id: function(){
			var _this = this;
			$.post(this.baseUrl + "/depot/getReserveRecord",{
				id: this.rr_id
			}, function(rsp){
				_this.info = rsp.data.info;
				_this.form_data['reserve_id'] = rsp.data.info.id;
				_this.form_data['order_item_id'] = rsp.data.info.order_item_id;
				_this.form_data['goods_id'] = rsp.data.info.goods_id;
				_this.form_data['spec'] = rsp.data.info.spec;
			},'json')
		}
	},
	template: `<form class="form-horizontal" role="form" method="post" style="width: 90%;">
					<div class="form-group">
						<label for="lastname" class="col-sm-2 control-label">商品</label>
						<div class="col-sm-4 form-control-static">
							{{ info.goods_name }} | {{ info.goods_color }}
						</div>
						<div class="col-sm-1"><img :src="info.pic" id="preview" height="220" style="position: absolute;"></div>
					</div>
					
					<div class="form-group">
						<label for="lastname" class="col-sm-2 control-label">尺码</label>
						<div class="col-sm-4 form-control-static">
							<select class="form-control" v-model="form_data.spec">
								<option value="">-请选择-</option>
								<option v-for="size in info.size_set" :value="size"> {{ size }} </option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="lastname" class="col-sm-2 control-label">数量</label>
						<div class="col-sm-4">
							<input type="text" class="form-control" v-model="form_data.qty">
						</div>
					</div>
					<div class="form-group">
						<label for="lastname" class="col-sm-2 control-label">备注</label>
						<div class="col-sm-4">
							<textarea class="form-control" rows="2" style="resize: none;" v-model="form_data.remarks"></textarea>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="button" class="btn btn-primary" @click="doArrivalEntry()">确认入库</button>
						</div>
					</div>
				</form>`,
	methods: {
		doArrivalEntry: function(){
			var data = this.form_data;
			var _this = this;
			$.post(this.baseUrl + "/depot/entryHandle",data, function(rsp){
				alert(rsp.msg)
				_this.$parent.$parent.showModal = false;
				_this.$parent.$parent.getList();
			},'json')
		},
	}
}